-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: compute world state #122
Conversation
fn encode_to_vec(&self) -> Vec<u8> { | ||
let mut buf = Vec::new(); | ||
self.encode(&mut buf); | ||
buf | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have this as a standalone generic function:
/// Function for encoding a value to RLP.
/// For encoding the value into a buffer directly, use [`RLPEncode::encode`].
pub fn encode<T: RLPEncode>(value: T) -> Vec<u8> {
let mut buf = Vec::new();
value.encode(&mut buf);
buf
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not have it as part of the trait? It is more legible and it is a common use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having it in the trait lets implementors override the default implementation. However, since it's for internal use this won't happen so let's leave it inside the trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
**Motivation** Obtain world state from account info stored in db **Description** * Implement storage root computation * Implement word state <!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 --> Closes lambdaclass#44
Motivation
Obtain world state from account info stored in db
Description
Closes #44